The present technique relates to an apparatus and method for using predicted result values.
A processing unit may comprise processing circuitry for executing a sequence of instructions, and often the processing circuitry is arranged in a pipelined arrangement, so that at any point in time a number of instructions can be in the process of being executed within the various stages of the pipeline. It is often the case that some instructions are dependent on the result of an earlier instruction, for example because they require as one of their source operands the result produced by that earlier instruction.
To seek to improve performance in such situations, it is known to provide value prediction circuitry that can maintain a predicted result value for one or more instructions, and typically the instructions chosen for this purpose are long latency instructions such as load instructions that miss in at least an initial level of cache. If a predicted result value is available for such an instruction forming the earlier instruction mentioned above, this would allow the processing circuitry to start execution of one or more dependent instructions, based on use of the predicted result value. Later it is then necessary to verify that the predicted result value did in fact match the actual result value produced when the earlier instruction was executed, and if the prediction is wrong, the processing circuitry will then need to re-execute the dependent instructions.
Such an approach can provide significant performance improvements provided that the predicted result values are accurate a significant proportion of the time. The performance benefits are particularly beneficial for long latency instructions, given the delay that is otherwise incurred before a dependent instruction dependent on the result of that long latency instruction can begin execution. However, for some long latency instructions it may not be possible to produce an accurate predicted result value. For example, considering load instructions, it may be difficult to produce a result value prediction in situations where there is no or little correlation between the data values loaded as a result of repeated execution of a particular load instruction, and in such instances the potential performance benefits of using value prediction have typically not been possible to realise.